﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Shine.Util.Convertor
{
    /// <summary>
    /// 角度各单位之间的转换
    /// </summary>
    public static class AngleConvertor
    {
        /// <summary>
        /// 度°转弧度
        /// </summary>
        /// <param name="degree"></param>
        /// <returns></returns>
        public static double Degree2Radian(double degree)
        {
            return degree * 0.0174533;
        }

        /// <summary>
        /// 分′转弧度
        /// </summary>
        /// <param name="minute"></param>
        /// <returns></returns>
        public static double Minute2Radian(double minute)
        {
            return minute * 0.0002909;
        }

        /// <summary>
        /// 秒″转弧度
        /// </summary>
        /// <param name="second"></param>
        /// <returns></returns>
        public static double Second2Radian(double second)
        {
            return second * 0.0000048481;
        }

        /// <summary>
        /// 弧度转度°
        /// </summary>
        /// <param name="radian"></param>
        /// <returns></returns>
        public static double Radian2Degree(double radian)
        {
            return radian * 57.29578;
        }

        /// <summary>
        /// 弧度转分′
        /// </summary>
        /// <param name="radian"></param>
        /// <returns></returns>
        public static double Radian2Minute(double radian)
        {
            return radian * 3437.7468;
        }

        /// <summary>
        /// 弧度转秒″
        /// </summary>
        /// <param name="radian"></param>
        /// <returns></returns>
        public static double Radian2Second(double radian)
        {
            return radian * 206264.808;
        }
    }
}
